package com.zhaowei.allinpay.order;


import com.zhaowei.allinpay.DemoUtils;
import com.zhaowei.allinpay.IDemoHandler;
import org.json.JSONArray;
import org.json.JSONObject;

public class AgentCollectApplySimplifyHandler implements IDemoHandler {
    @Override
    public JSONObject getRequestParams() throws Exception {
        String bizOrderNo = System.currentTimeMillis() + "ds";


        JSONObject quickPayPC = new JSONObject();
        quickPayPC.put("amount", 3500);

        JSONObject coupon = new JSONObject();
        coupon.put("amount", 3500);

        JSONArray balances = new JSONArray();
        JSONObject balance = new JSONObject();
        balance.put("amount", 3500);
        balance.put("accountSetNo","200001");
        balances.put(balance);
        
        JSONObject scanalipay = new JSONObject();
        scanalipay.put("payType","A01");
        scanalipay.put("amount",3500);

        JSONObject realNamePay = new JSONObject();
        realNamePay.put("bankCardNo", DemoUtils.rsaEncrypt("6228483232323256666"));
        realNamePay.put("amount",3500);
        
        
        JSONObject gateway = new JSONObject();
        gateway.put("amount",3500);
        gateway.put("bankCode","vbank");
        gateway.put("payType",1);
        
        JSONObject codepaya = new JSONObject();
        codepaya.put("amount",3500);
        codepaya.put("authcode","2800012528218522444");
        /*JS微信支付*/
        JSONObject wechatpublic = new JSONObject();
        wechatpublic.put("amount",10);
        wechatpublic.put("payType","");
        wechatpublic.put("acct","111111");
        
        //组装支付方式
        JSONObject payMethod = new JSONObject();
//        payMethod.put("QUICKPAY_PC", quickPayPC);
//        payMethod.put("COUPON",coupon);
//        payMethod.put("BALANCE",balances);
          /*支付宝被扫*/
//        payMethod.put("CODEPAY_A",codepaya);
          /*支付宝主扫*/
//        payMethod.put("SCAN_ALIPAY",scanalipay);
          /*实名支付*/
//        payMethod.put("REALNAMEPAY", realNamePay);
        /*网关支付*/
//        payMethod.put("GATEWAY",gateway);
        payMethod.put("WECHAT_PUBLIC",wechatpublic);
        
        JSONObject param = new JSONObject();
        param.put("bizOrderNo", bizOrderNo);
        param.put("payerId", "zhanxh");
//        param.put("goodsType", );
//        param.put("goodsNo", "");
        param.put("tradeCode", "3001");
        param.put("amount", 10);
        param.put("fee", 0);
        param.put("validateType", 1);
        param.put("frontUrl", "http://122.227.225.142:23661/gateway/getPayFront.jsp");
        param.put("backUrl", "http://122.227.225.142:23661/test/recievePayBack.jsp");
//        param.put("ordErexpireDatetime", 0);
        param.put("payMethod", payMethod);
        param.put("goodsName", "test_goodsName");
        param.put("goodsDesc", "test_goodsDesc");
        param.put("industryCode", "1010");
        param.put("industryName", "保险行业");
        param.put("source", 2);
        param.put("summary", "Test3502");
        param.put("extendInfo", "Test3502");

        return param;
    }
}
